import { createI18n } from "vue-i18n";
const modules: any = import.meta.glob(["./*.ts", "!./i18n.ts"], {
  import: "default",
  eager: true
});
const messages: any = {};
Object.keys(modules).forEach(key => {
  const filename = key.replace(/.*\/([^\/]*)\.ts/gi, "$1");
  messages[filename] = modules[key];
});
const language = LocalStorage.getItem("language") || "en";
const i18n = createI18n({
  locale: language,
  globalInjection: true,
  legacy: false,
  messages: {
    ...messages
  }
});
export default i18n;
